package com.testing.sunnycommon.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.testing.sunnycommon.mapper.SunnyResultDetailMapper;
import com.testing.sunnycommon.model.SunnyResultDetail;
import com.testing.sunnycommon.service.SunnyResultDetailService;
import org.springframework.stereotype.Service;

/**
 * @Classname SunnyResultDetailServiceImpl
 * @Description 类型说明
 * @Date 2023/5/29 21:43
 * @Created by 特斯汀Roy
 */
@Service("sunnyResultDetailService")
public class SunnyResultDetailServiceImpl extends ServiceImpl<SunnyResultDetailMapper, SunnyResultDetail> implements SunnyResultDetailService {
    @Override
    public SunnyResultDetail getLastSunnyResultDetail() {
        return getOne(new LambdaQueryWrapper<SunnyResultDetail>()
                .orderByDesc(SunnyResultDetail::getId)
                .last("limit 1"));
    }
}
